What is sqlcode -911?

SQLCODE -911 is an error code in IBM DB2 database management system that signifies a deadlock as a result of two or more transactions being blocked and waiting for each other to release a resource or lock. This can occur when multiple transactions are trying to access the same database object at the same time, such as a table or a row, and each transaction is waiting for the other to release the lock.

When SQLCODE -911 occurs, the transaction that receives the error message is rolled back and must be resubmitted. The error message usually contains information about the objects involved in the deadlock, enabling system administrators to resolve the issue.

DB2 provides several options for resolving deadlock situations, including reorganizing database objects, adjusting transaction isolation levels, and using explicit locking techniques. It's important to regularly monitor for deadlock errors and take preventive steps to avoid them in the future.